//
//  TwoUserCell.m
//  BeautyClother
//
//  Created by dllo on 15/10/6.
//  Copyright (c) 2015年 宋爽. All rights reserved.
//

#import "TwoUserCell.h"

@implementation TwoUserCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.image = [[UIImageView alloc] init];
        [self.contentView addSubview:_image];
        [_image release];
        
        self.avatar = [[UIImageView alloc] init];
        [self.contentView addSubview:_avatar];
        [_avatar release];
        
        self.username = [[UILabel alloc] init];
        [self.contentView addSubview:_username];
        [_username release];
        
        self.signature = [[UILabel alloc] init];
        [self.contentView addSubview:_signature];
        [_signature release];
        
        self.intro = [[UILabel alloc] init];
        [self.contentView addSubview:_intro];
        [_intro release];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    CGFloat offwidth = [UIScreen mainScreen].bounds.size.width / 375;
    
    CGFloat offheight = [UIScreen mainScreen].bounds.size.height / 667;
    
    
    
    self.image.frame = CGRectMake(5, self.intro.frame.size.height + self.intro.frame.origin.y, self.contentView.frame.size.width - 10, 200 * offheight);
    
    self.avatar.frame = CGRectMake(5, self.image.frame.size.height + self.image.frame.origin.y + 10 * offheight, 40 * offwidth, 40 * offwidth);
    self.avatar.layer.cornerRadius = 20 * offwidth;
    self.avatar.layer.masksToBounds = YES;
    
    self.username.frame = CGRectMake(self.avatar.frame.size.width + self.avatar.frame.origin.x + 10 * offwidth, self.image.frame.size.height + self.image.frame.origin.y + 10 * offheight, 100 * offwidth, 30 * offheight);
    self.username.textColor = [UIColor blackColor];
    
    self.signature.frame = CGRectMake(self.avatar.frame.size.width + self.avatar.frame.origin.x + 10 * offwidth, self.username.frame.size.height + self.username.frame.origin.y + 5 * offheight, 250 * offwidth, 40 * offheight);
    self.signature.textColor = [UIColor lightGrayColor];
    self.signature.font = [UIFont systemFontOfSize:15];
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
